{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Hexgonal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "%pylab inline\n",
    "from TX import upf, cmb\n",
    "import time\n",
    "reload(upf)\n",
    "\n",
    "from MP.lib import whichcomp\n",
    "\n",
    "\n",
    "if whichcomp.clues()=='Darwin':\n",
    "    #grs_iso=cmb.random(360,360,360,5000)\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/az31/LS_AZ31_1.3mm.tex'\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/ze10/LS_ZE10_1.3mm.tex'\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/mat/bcc/gamma_fib_ngr00100_sigma015.cmb'\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/dat/B_ST_06000.cmb'  \n",
    "    filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/hcp_fib/mg_textures_08000_dbl_lets_50.cmb'\n",
    "    filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/hcp_fib/mg_textures_08000_dbl_lets_30.cmb'\n",
    "elif whichcomp.clues()=='Linux':\n",
    "    filename='/users/ynj/repo/vpsc-fld/examples/ex15_FLD/magnesium/ze10/LS_ZE10_1.3mm.tex'\n",
    "\n",
    "mypf=upf.polefigure(filename=filename,\n",
    "    #grains=grs_iso,\n",
    "    csym='hexag',cdim=[1,1,1.6235])\n",
    "\n",
    "t0=time.time()\n",
    "mypf.pf_new(poles=[[0,0,0,2],[1,0,-1,1]],\n",
    "            n_rim=2,lev_opt=0,lev_norm_log=True,\n",
    "            nlev=6,cmap='jet',dth=10,dph=10,mn=0.6)\n",
    "print 'pf_new time:', time.time()-t0\n",
    "\n",
    "plt.tight_layout()\n",
    "gcf().savefig('temp_pf.pdf',bbox_inches='tight')\n",
    "gcf().savefig('temp_pf.png',bbox_inches='tight',transparent=True)\n",
    "\n",
    "#t0=time.time()\n",
    "#mypf.pf(pole=[[0,0,0,2],[1,0,-1,1]],ifig=3)\n",
    "#print 'pf_old:',time.time()-t0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Cubic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "if whichcomp.clues()=='Darwin':\n",
    "    #grs_iso=cmb.random(360,360,360,5000)\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/az31/LS_AZ31_1.3mm.tex'\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/magnesium/ze10/LS_ZE10_1.3mm.tex'\n",
    "    filename='/Users/yj/repo/vpsc/vpsc-dev-fld/mat/bcc/gamma_fib_ngr02000_sigma015.cmb'\n",
    "    #filename='/Users/yj/repo/vpsc/vpsc-dev-fld/examples/ex15_FLD/dat/B_ST_06000.cmb'\n",
    "elif whichcomp.clues()=='Linux':\n",
    "    filename='/users/ynj/repo/vpsc-fld/mat/bcc/alpha_fib_ngr02000_sigma015.cmb'\n",
    "\n",
    "    \n",
    "\n",
    "mypf=upf.polefigure(filename=filename,\n",
    "    #grains=grs_iso,\n",
    "    csym='cubic',cdim=[1,1,1.])\n",
    "\n",
    "pole=[[0,0,1],[1,1,0],[1,1,1],[2,1,1]]\n",
    "\n",
    "t0=time.time()\n",
    "mypf.pf_new(poles=pole,dth=7.5,dph=7.5,n_rim=2,cmap='jet',lev_opt=0)\n",
    "print 'pf_new:', time.time()-t0\n",
    "\n",
    "#t0=time.time()\n",
    "#mypf.pf(pole=pole,ifig=3)\n",
    "#print 'pf_old:',time.time()-t0"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
